package com.rfsp.mcp.pojo.vo;


public class OrderVo {
	String value;
	String submitValue;
	
	
	/**
	 * OrderVo orderVo=new OrderVo("desc",request.getParameter("uploadTimerOrder"),request.getParameter("uploadTimerOrderSubmit"));
		formObject.put("uploadTimerOrder", orderVo.getValue());
		formObject.put("uploadTimerOrderSubmit", orderVo.getSubmitValue());
		
	 * @param defaultValue
	 * @param value
	 * @param submitValue
	 */
	public OrderVo(String defaultValue,String value,String submitValue){
		this.value=defaultValue;
		if(value!=null){
			this.value=value;
		}
		if(submitValue!=null){
			this.value=submitValue;
		}
		if("desc".equals(this.value)){
			this.submitValue="asc";
		}else if("asc".equals(this.value)){
			this.submitValue="";
		}else{
			this.submitValue="desc";
		}
	}
	
	/**
	 * 只需要有正序和倒叙，不需要“-”排序，默认倒序排序
	 * @param defaultValue
	 * @param value
	 * @param submitValue
	 * @param typeNum
	 */
	public OrderVo(String defaultValue,String value,String submitValue,int typeNum){
		this.value=defaultValue;
		if(value!=null){
			this.value=value;
		}
		if(submitValue!=null){
			this.value=submitValue;
		}
		if(2==typeNum) {
			if("desc".equals(this.value)){
				this.submitValue="asc";
			}else if("asc".equals(this.value)){
				this.submitValue="desc";
			}
		}
		if(3==typeNum) {
			if("desc".equals(this.value)){
				this.submitValue="asc";
			}else if("asc".equals(this.value)){
				this.submitValue="";
			}else{
				this.submitValue="desc";
			}
		}
	}
	
	
	
	/**
	 * create by yangxing
	 * 只需要有正序和倒叙，不需要“-”排序，默认倒序排序
	 */
	public OrderVo(String value,String submitValue){
		this.value="desc";//默认倒叙
		if(value!=null){
			this.value=value;
		}
		if(submitValue!=null && !submitValue.equals("")){
			this.value=submitValue;
		}
		if("desc".equals(this.value)){
			this.submitValue="asc";
		}else if("asc".equals(this.value)){
			this.submitValue="desc";
		}
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getSubmitValue() {
		return submitValue;
	}
	public void setSubmitValue(String submitValue) {
		this.submitValue = submitValue;
	}
	
	
}
